<template>
    <div class="marLR20">
        <div class="tableWrapper marT20 padd20">
            <el-row :gutter="20">
                <el-tag :type="isEduExperShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getEduExper(2)">教育经历</el-tag>
                <el-tag :type="isRewardsShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getRewards">奖惩记录</el-tag>
                <el-tag :type="isPostTransShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getPostTrans">调岗记录</el-tag>
                <el-tag :type="isUserStatusShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getUserStatus">人员状态</el-tag>
                <el-tag :type="isOccGradeShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getOccGrade">职业技能</el-tag>
            </el-row>
        </div>

        <!-- 紧急联系人 -->
        <div class="marT20" v-show="isEduExperShow">
            <el-table
                :data="eduList"
                border
                style="width: 100%">
                <el-table-column
                align="center"
                prop="eduName"
                label="学历">
                </el-table-column>
                <el-table-column
                align="center"
                prop="gradSchool"
                label="毕业院校">
                </el-table-column>
                <el-table-column
                align="center"
                prop="gradTime"
                label="毕业时间">
                </el-table-column>
                <el-table-column
                align="center"
                prop="professName"
                label="专业名称">
                </el-table-column>
            </el-table>
        </div>

        <!-- 奖惩记录 -->
        <div class="marT20" v-show="isRewardsShow">
            <el-table
                :data="rewardList"
                border
                style="width: 100%">
                <el-table-column
                align="center"
                prop="fileNum"
                label="文件编号">
                </el-table-column>
                <el-table-column
                align="center"
                prop="rewardTypeName"
                label="奖惩类型">
                </el-table-column>
                <el-table-column
                align="center"
                prop="rewardsTime"
                label="奖惩日期">
                </el-table-column>
                <el-table-column
                align="center"
                prop="rewardsMoney"
                label="奖惩金额">
                </el-table-column>
                <el-table-column
                align="center"
                prop="rewardsReason"
                label="奖惩原因">
                </el-table-column>
            </el-table>
        </div>

        <!-- 调岗记录 -->
        <div class="marT20" v-show="isPostTransShow">
            <el-table
                :data="postTransList"
                border
                style="width: 100%">
                <!-- <el-table-column
                align="center"
                prop="fileNum"
                label="文件编号">
                </el-table-column> -->
                <el-table-column
                align="center"
                prop="postAdjustNum"
                label="文件编号">
                </el-table-column>
                <el-table-column
                align="center"
                label="原部门">
                    <template slot-scope = "scope">
                        <span :title = "scope.row.oldDepartName">{{scope.row.oldDepartName.split('/').pop()}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                align="center"
                label="新部门">
                    <template slot-scope = "scope">
                        <span :title = "scope.row.newDepartName">{{scope.row.newDepartName.split('/').pop()}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                align="center"
                prop="oldPostName"
                label="原职位">
                </el-table-column>
                <el-table-column
                align="center"
                prop="newPostName"
                label="新职位">
                </el-table-column>
                <el-table-column
                align="center"
                label="调岗时间">
                    <template slot-scope="scope">
                        {{scope.row.postAdjustTime.split(' ')[0]}}
                    </template>
                </el-table-column>
                <el-table-column
                align="center"
                prop="postAdjustReason"
                label="调岗原因">
                </el-table-column>
            </el-table>
        </div>

        <!-- 人员状态记录 -->
        <div class="marT20" v-show="isUserStatusShow">
            <el-table
                :data="userStatusList"
                border
                style="width: 100%">
                <el-table-column
                align="center"
                prop="workNatureName"
                label="工作状态">
                </el-table-column>
                <el-table-column
                align="center"
                prop="eventTime"
                label="开始时间">
                </el-table-column>
                <el-table-column
                align="center"
                prop="endEventTime"
                label="结束时间">
                </el-table-column>
                <el-table-column
                    prop="name"
                    align="center"
                    label="操作">
                    <template slot-scope="scope">
                        <span class="marR15" title="下载合同"  v-if = "scope.row.workNature !== 6 && scope.row.workNature !== 7 && scope.row.workNature !== 10">
                            <icon name="download" class="scaleIcon1 svgColor" @click.native.stop="downLoadContract(scope.row.userStatusId)" style="cursor:pointer;"></icon>
                        </span>
                        <el-popover
                            placement="top-start"
                            width="200"
                            v-model = "scope.row.isPreviewContractIconShow"
                            trigger="manual">
                                <!-- 实习生合同 -->
                                <div v-if = "previewContractMsg && previewContractMsg.contract_templ_id === 1">
                                    <p class="ellipsis" :title="previewContractMsg.contract_num">合同编号:{{previewContractMsg.contract_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_name">乙方姓名:{{previewContractMsg.user_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_sex === 1 ? '男' : '女'">乙方性别:{{previewContractMsg.user_sex === 1 ? '男' : '女'}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_card_num">身份证号:{{previewContractMsg.user_card_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_tel">联系电话:{{previewContractMsg.user_tel}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.ini_school">在读学校:{{previewContractMsg.ini_school}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.concat_address">联系地址:{{previewContractMsg.concat_address}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.native_place">籍贯:{{previewContractMsg.native_place}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.event_time">开始时间:{{previewContractMsg.event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.structName">组织:{{previewContractMsg.structName}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pos_name">职位:{{previewContractMsg.pos_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.money">月基本工资:{{previewContractMsg.money}}</p>
                                </div>
                                <!-- 试用期合同 -->
                                <div v-if = "previewContractMsg && previewContractMsg.contract_templ_id === 2">
                                    <p class="ellipsis" :title="previewContractMsg.contract_num">合同编号:{{previewContractMsg.contract_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_name">乙方姓名:{{previewContractMsg.user_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_sex === 1 ? '男' : '女'">乙方性别:{{previewContractMsg.user_sex === 1 ? '男' : '女'}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_card_num">身份证号:{{previewContractMsg.user_card_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.event_time">开始时间:{{previewContractMsg.event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.end_event_time">结束时间:{{previewContractMsg.end_event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.structName">组织:{{previewContractMsg.structName}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pos_name">职位:{{previewContractMsg.pos_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.money">月基本工资:{{previewContractMsg.money}}</p>
                                </div>
                                <!-- 正式合同(首签合同 续签合同 无固定期限合同  ) -->
                                <div v-if = "previewContractMsg && previewContractMsg.contract_templ_id === 3">
                                    <p class="ellipsis" :title="previewContractMsg.contract_num">合同编号:{{previewContractMsg.contract_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_name">乙方姓名:{{previewContractMsg.user_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.event_time">开始时间:{{previewContractMsg.event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.end_event_time === null ? '/' : previewContractMsg.end_event_time">结束时间:{{previewContractMsg.end_event_time === null ? '/' : previewContractMsg.end_event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.structName">组织:{{previewContractMsg.structName}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pos_name">职位:{{previewContractMsg.pos_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.money">月基本工资:{{previewContractMsg.money}}</p>
                                </div>
                                <!-- 退休返职合同 -->
                                <div v-if = "previewContractMsg && previewContractMsg.contract_templ_id === 4">
                                    <p class="ellipsis" :title="previewContractMsg.contract_num">合同编号:{{previewContractMsg.contract_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_name">乙方姓名:{{previewContractMsg.user_name}}</p>
                                        <p class="ellipsis" :title="previewContractMsg.user_sex === 1 ? '男' : '女'">乙方性别:{{previewContractMsg.user_sex === 1 ? '男' : '女'}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_card_num">身份证号:{{previewContractMsg.user_card_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_tel">联系电话:{{previewContractMsg.user_tel}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.concat_address">联系地址:{{previewContractMsg.concat_address}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.event_time">开始时间:{{previewContractMsg.event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.end_event_time">结束时间:{{previewContractMsg.end_event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pos_name">职位:{{previewContractMsg.pos_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.money">月基本工资:{{previewContractMsg.money}}</p>
                                </div>
                                <!-- 钟点工合同 -->
                                <div v-if = "previewContractMsg && previewContractMsg.contract_templ_id === 5">
                                    <p class="ellipsis" :title="previewContractMsg.contract_num">合同编号:{{previewContractMsg.contract_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_name">乙方姓名:{{previewContractMsg.user_name}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_card_num">身份证号:{{previewContractMsg.user_card_num}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.user_tel">联系电话:{{previewContractMsg.user_tel}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.am_start_time">上午开始开始时间:{{previewContractMsg.am_start_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pm_start_time">下午结束时间:{{previewContractMsg.pm_start_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.am_hours">上午小时数:{{previewContractMsg.am_hours}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.pm_hours">下午小时数:{{previewContractMsg.pm_hours}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.event_time">开始时间:{{previewContractMsg.event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.end_event_time">结束时间:{{previewContractMsg.end_event_time}}</p>
                                    <p class="ellipsis" :title="previewContractMsg.money">小时工资:{{previewContractMsg.money}}</p>
                                </div>
                                <span title="合同摘要"  slot="reference" v-if = "scope.row.workNature !== 6 && scope.row.workNature !== 7 && scope.row.workNature !== 10"><icon name="contractView" class="scaleIcon1 svgColor"  @mouseenter.stop.native = "previewContract(scope.row.userStatusId,scope.row.ctId,scope.$index)"  @mouseleave.stop.native = "handleMouseOut(scope.$index)" style="cursor:pointer;"></icon></span>
                                <span  slot="reference" v-else>/</span>
                            </el-popover>
                    </template>
                </el-table-column>
            </el-table>
        </div>

        <!-- 职业技能 -->
        <div class="marT20" v-show="isOccGradeShow">
            <el-table
                :data="occGradeList"
                border
                style="width: 100%">
                <el-table-column
                align="center"
                prop="occGradeStr"
                label="职业技能">
                </el-table-column>
                <el-table-column
                align="center"
                prop="eventTime"
                label="开始时间">
                </el-table-column>
            </el-table>
        </div>

    </div>
</template>

<script>

import http from '@/assets/js/http'
import _g from '@/assets/js/global'

import { downFile} from "@/assets/js/common.js"

export default {
    data(){
        return {
            /* 教育经历 */
            isEduExperShow:true,//    教育经历默认显示
            eduList:[],                                                      //  教育经历列表

            /* 奖惩记录 */
            isRewardsShow:false,//    奖惩记录默认隐藏
            rewardList:[],                                                      //  奖惩记录列表

            /* 调岗记录 */
            isPostTransShow : false,//  调岗记录默认隐藏 
            postTransList:[],                                                      //  调岗记录列表

            /* 人员状态 */
            isUserStatusShow : false,//    人员状态记录默认隐藏
            userStatusList:[],                                                      //  人员状态记录列表
            previewContractMsg : null,//   合同摘要信息

            /* 职业技能 */
            isOccGradeShow : false,//    职业技能记录默认隐藏
            occGradeList:[],                                                      //   职业技能记录列表
        }
    },
    created () {
        this.getEduExper(1) 
    },
    methods: {

        /* 批量重置标签对应各版块隐藏 */
        resetTagModuleHide(){
            this.isEduExperShow = false
            this.isRewardsShow = false
            this.isPostTransShow = false
            this.isUserStatusShow = false
            this.isOccGradeShow = false
        },
        /* 获取学历名称 */
        getEduName(type){
            let eduName = ''
            switch(type){
                case 1:
                    eduName = '初中及以下'
                    break
                case 2:
                    eduName = '高中'
                    break
                case 3:
                    eduName = '专科'
                    break
                case 4:
                    eduName = '本科(成教)'
                    break
                case 5:
                    eduName = '本科(民办 / 自考)'
                    break
                case 6:
                    eduName = '本科(二本)'
                    break
                case 7:
                    eduName = '本科(一本)'
                    break
                case 8:
                    eduName = '本科(211)'
                    break
                case 9:
                    eduName = '本科(985)'
                    break
                case 10:
                    eduName = '硕士 / 工硕'
                    break
                case 11:
                    eduName = '博士'
                    break
            }
            return eduName;
        },
        /* 获取奖惩类型名称 */
        getRewardTypeName(type){
            let rewardTypeName = ''
            switch(type){
                case 1:
                    rewardTypeName = '奖励'
                    break
                case 2:
                    rewardTypeName = '口头警告'
                    break
                case 3:
                    rewardTypeName = '书面警告'
                    break
                case 4:
                    rewardTypeName = '一类事故'
                    break
                case 5:
                    rewardTypeName = '二类事故'
                    break
                case 6:
                    rewardTypeName = '三类事故'
                    break
                case 7:
                    rewardTypeName = '四类事故'
                    break
                case 8:
                    rewardTypeName = '五类事故'
                    break
                case 9:
                    rewardTypeName = '六类事故'
                    break
            }
            return rewardTypeName;
        },
        /* 获取工作状态名称 */
        getWorkNatureName(type){
            let workNatureName = ''
            switch(type){
                case 1:
                    workNatureName = '在校实习生'
                    break
                case 2:
                    workNatureName = '试用'
                    break
                case 3:
                    workNatureName = '首签合同'
                    break
                case 4:
                    workNatureName = '续签合同'
                    break
                case 5:
                    workNatureName = '无固定期限合同'
                    break
                // case 6:
                //     workNatureName = '停薪留职'
                //     break
                case 7:
                    workNatureName = '离职'
                    break
                case 8:
                    workNatureName = '退休返职'
                    break
                case 9:
                    workNatureName = '钟点工'
                    break
                case 10:
                    workNatureName = '兼职'
                    break
            }
            return workNatureName;
        },

        /* 根据用户id查询所有通过审核的教育经历 */
        getEduExper(isIniLoad){
            const that = this
            let eduList = []

            // 如果不是初次加载且对应版块处于隐藏状态或初次加载
                if(isIniLoad === 2 && !that.isEduExperShow || isIniLoad === 1){
                    _g.showLoading('加载中')
                    that.apiPost('admin/resume/queryEduExperByUserIdPass').then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                            res = JSON.parse(res)
                        }
                        if (res.code != 200) {
                            that.handleError(res)
                        } else {
                            if(res.data.isSuccess === 0){             //  成功
                                // // 教育经历初始化
                                for(let education of res.data.eduExperList){
                                    eduList.push({
                                        eduId : education.id,
                                        education : education.education,
                                        eduName : that.getEduName(education.education),
                                        gradSchool : education.graduated_school,
                                        gradTime : education.graduated_time,
                                        professName : education.professional_name,
                                        auditStatus : education.audit_status,
                                        auditFailReason : education.audit_fail_reason || '/',
                                    })
                                }
                                that.eduList = eduList

                                that.resetTagModuleHide()
                                that.isEduExperShow = true
                            }else{
                                _g.toastMsg("error", res.message)
                            }
                        }
                    })
            }
        },

         /* 根据用户id查询所有通过审核的奖惩记录 */
        getRewards(){
            const that = this
            let rewardList = []

            if(!that.isRewardsShow){//    如果折叠
                _g.showLoading('加载中')
                that.apiPost('admin/resume/queryRewardByUserIdPass').then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                        // 奖惩记录初始化
                            for(let item of res.data.rewardsList){
                                rewardList.push({
                                    rewardId : item.id,
                                    rewardsType : item.rewards_type,
                                    rewardTypeName : that.getRewardTypeName(item.rewards_type),
                                    rewardsTime : item.rewards_time,
                                    rewardsReason : item.rewards_reason,
                                    rewardsMoney : item.rewards_money,
                                    fileNum : item.file_num,
                                })
                            }
                            that.rewardList = rewardList

                            that.resetTagModuleHide()
                            that.isRewardsShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },

           /* 根据用户id查询所有通过审核的调岗记录 */
        getPostTrans(){
            const that = this
            let postTransList = []

            if(!that.isPostTransShow){
                _g.showLoading('加载中')
                that.apiPost('admin/resume/queryPostTransByUserIdPass').then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            // 岗位调动记录初始化
                            for(let item of res.data.postTransList){
                                postTransList.push({
                                    postTransId : item.id,
                                    postAdjustTime : item.post_adjust_time,
                                    postAdjustNum : item.post_adjust_num,
                                    // oldPostId : item.old_post_id,
                                    // newPostId : item.new_post_id,
                                    // oldDepartId : item.old_depart_id,
                                    // newDepartId : item.new_depart_id,
                                    // oldPostName : item.old_post_name,
                                    // newPostName : item.new_pos_name,
                                    // oldDepartName : item.old_depart_name,
                                    // newDepartName : item.new_depart_name,
                                    oldPostName : item.old_read_only_post_name,
                                    newPostName : item.new_read_only_post_name,
                                    oldDepartName : item.old_read_only_depart_name,
                                    newDepartName : item.new_read_only_depart_name,
                                    postAdjustReason : item.post_adjust_reason,
                                    // fileNum : item.file_num,
                                })
                            }
                            that.postTransList = postTransList

                            that.resetTagModuleHide()
                            that.isPostTransShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },

        /* 根据用户id查询所有通过审核的人员状态记录 */
        getUserStatus(){
            const that = this
            let userStatusList = []

            if(!that.isUserStatusShow){
                _g.showLoading('加载中')
                that.apiPost('admin/resume/queryUserStatusByUserIdPass').then((res) => {
                     _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            // 人员状态记录初始化
                            for(let item of res.data.userStatusList){
                                userStatusList.push({
                                    userStatusId : item.id,
                                    workNature : item.work_nature,
                                    workNatureName : that.getWorkNatureName(item.work_nature),
                                    eventTime : item.event_time,
                                    endEventTime : item.end_event_time || '/',
                                    ctId : item.contract_templ_id,
                                    isPreviewContractIconShow : false
                                })
                            }
                            that.userStatusList = userStatusList

                            that.resetTagModuleHide()
                            that.isUserStatusShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },

        
        /* 鼠标移出预览合同 */
        handleMouseOut(index){
            this.previewContractMsg = null
            this.userStatusList[index].isPreviewContractIconShow = false
        },

        /* 预览合同 */
        previewContract(userStatusId,ctId,index){
            const that = this
            // if(isPreviewContractIconShow){//   如果合同摘要信息弹框已经显示
            //     return
            // }

            let previewContractMsg = null

            let structNameArr = []

            let arr = that.userStatusList.filter(item => item.isPreviewContractIconShow === true)
            if(arr.length > 0){//   确保每次只有一次请求，防止重复请求
                return
            }

            _g.showLoading('加载中')

            that.apiPost('admin/contract/queryContractByUserStatusId',{userStatusId}).then(res => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if(res.data.isSuccess === 0){
                    // that.previewContractMsg = res.data.contract
                    // that.userStatusList[index].isPreviewContractIconShow = true
                    previewContractMsg = res.data.contract
                    for(let item of res.data.userBaseInfo.infiniteLevelStructure){
                        structNameArr.push(item.label)
                    }
                    previewContractMsg['structName'] = structNameArr.join(' / ')
                    that.previewContractMsg = JSON.parse(JSON.stringify(previewContractMsg))
                    that.userStatusList[index].isPreviewContractIconShow = true
                }else if(res.data.isSuccess === 1){
                    _g.toastMsg('error',res.message)
                }
            }).catch((error) => {})
        },

        /* 下载人员状态记录对应的合同 */
        downLoadContract(userStatusId){
            const that = this
            const userId = that.userId
            let data = {
                userStatusId,

            }
            const url = 'admin/contract/downLoadContractPass'//  请求路径
            that.$confirm('是否确认下载?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                center: true
            }).then(() => {
                _g.showLoading('下载中')
                that.apiPost(url,data).then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                   
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            _g.toastMsg("success", res.message)
                            location.href = res.data.webUrl
                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }).catch(() => {})
        },

        /* 根据用户id查询所有通过审核的职业技能记录 */
        getOccGrade(){
            const that = this
            let occGradeList = []

            if(!that.isOccGradeShow){
                _g.showLoading('加载中')
                that.apiPost('admin/resume/queryOccGradeByUserIdPass').then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            // 职业技能记录初始化
                            for(let item of res.data.occGradeList){
                                occGradeList.push({
                                    occGradeId : item.id,
                                    occGradeStr : item.occ_grade_str,
                                    eventTime : item.event_time,
                                })
                            }
                            that.occGradeList = occGradeList

                            that.resetTagModuleHide()
                            that.isOccGradeShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },
    },
    mixins: [http]
}
</script>

